package com.taxi.controller;

import com.taxi.result.Result;
import com.taxi.service.DistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: aniu
 * @Date: 2023/9/26
 * @ClassName: DistrictController
 * @Description: 地区字典的拉取
 * @Version: 1.0
 */
@RestController
public class DistrictController {
    @Autowired
    private DistrictService districtService;

    /**
     * 使用高德地图api拉取地区信息
     * @param keywords
     * @return
     */
    @GetMapping("/dic-district")
    public Result initDicDistrict(String keywords){
        return districtService.initDicDistrict(keywords);
    }

    /**
     * 直接用本地数据库地区字典信息
     * @return
     */
    @GetMapping("/district")
    public Result getDistrictInfo(){
        return districtService.getDistrictInfo();
    }
}
